import {debounce} from "./utils"
import BackTop from '../components/content/backTop/backtop'

export const itemListenerMixin = {
    mounted(){
        const refresh = debounce(this.$refs.scroll.refresh,100);
        this.$bus.$on("itemImageLoad", () => {
            refresh();
        });
    }
}

export const backTopMiXin = {
    components:{
        BackTop
    },
    data() {
        return {
            isshow:false,
        }
    },
    methods:{
        backclick() {
            //获取scroll中的scrollTo设定它的滚动距离
            this.$refs.scroll.scroll.scrollTo(0, 0, 500)
        }
    }
}

